package com.ynny.Service;

import com.ynny.Dao.CourseManagerDao;
import com.ynny.Entity.Courses;
import com.ynny.Entity.optional_courses;
import com.ynny.Service.ConrseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public class CourseServiceImp implements ConrseService {
    @Autowired
    private optional_coursesDao optional_coursesDao;
    @Autowired
    private CourseManagerDao courseManagerDao;

    @Override
    public int selectCourse(String number, String courseName) {
        return optional_coursesDao.addCourse(number,courseName,0.0);
    }

    @Override
    public List<Courses> query() {
        return courseManagerDao.queryCourse();
    }

    @Override
    public optional_courses queryCourseByNumber(String number) {
        return optional_coursesDao.CourseByNumber(number);
    }
}
